package com.zh.note.huawei.onehundred.RSA加密算法素数之积;

import java.util.Scanner;

/**
 * @Author: zhanghuan
 * @date: 2023/9/3 19:37
 * @description: create it
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int x = -1;
        int y = -1;
        double sqrt = Math.sqrt(num);
        for (int i = (int) sqrt; i >= 2; i--) {
            if (num % i == 0) {
                if (isPrime(i) && isPrime(num / i)) {
                    x = i;
                    y = num / i;
                    break;
                }
            }
        }
        System.out.println(x + " " + y);
    }

    //判断是否素数
    private static boolean isPrime(int n) {

        if (n == 1 || n == 0) {
            return false;
        }
        for (int i = 2; i * i <= n; i++) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }

}
